package cn.itcast.controller;

import cn.itcast.core.BaseServlet;
import cn.itcast.core.ResponseBody;
import cn.itcast.domain.County;
import cn.itcast.service.CountyService;
import cn.itcast.service.impl.CountyServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@WebServlet("/CountyController/*")
public class CountyController extends BaseServlet {

    private CountyService countyService = new CountyServiceImpl();


    @ResponseBody
    public Object findAll(HttpServletRequest request, HttpServletResponse response) throws Exception{
        String key = request.getParameter("key");
        List<County> list = countyService.findAll(key);
        return list;
    }
}
